package com.colourclash.fruitopia.utils
{
	import flash.display.DisplayObject;
	import flash.display.Stage;
	
	/**
	 * ...
	 * @author Patrick
	 */
	public final class Global
	{
		private static var _instance:Global;
		
		public var stage:Stage;
		
		public function Global()
		{
			if (_instance)
				throw new Error("Singleton... use getInstance()");
		}
		
		public static function getInstance():Global
		{
			if (!_instance)
				_instance = new Global();
			
			return _instance;
		}
		
		public function getScale():Number 
		{
			return stage.stageWidth / 525;
		}
		
				
		public function sizeToStage(displayObject:DisplayObject):void 
		{
			displayObject.width  *= getScale();
			displayObject.height *= getScale();
		}
	}

}